package com.ruoyi.elebook.domain;

import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.web.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.ArrayList;
import java.util.List;

/**
 * 分类对象 book_class
 *
 * @author ruoyi
 * @date 2023-12-11
 */
public class BookClass extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 分类id */
    private Long id;

    /** 代号码 */
    @Excel(name = "代号码")
    private Long code;

    /** 书籍名称 */
    @Excel(name = "书籍名称")
    private String name;

    /** 概要、简介 */
    @Excel(name = "概要、简介")
    private String synopsis;

    /** 父级分类id */
    @Excel(name = "父级分类id")
    private Long parentId;

    /** 祖级列表 */
    private String ancestors;
    /** 显示顺序 */
    @Excel(name = "显示顺序")
    private Integer orderNum;
    /** 父部门名称 */
    private String parentName;

    /** 子部门 */
    private List<BookClass> children = new ArrayList<BookClass>();
    public void setId(Long id)
    {
        this.id = id;
    }

    public Long getId()
    {
        return id;
    }
    public void setCode(Long code)
    {
        this.code = code;
    }

    public Long getCode()
    {
        return code;
    }
    public void setName(String name)
    {
        this.name = name;
    }

    public String getName()
    {
        return name;
    }
    public void setSynopsis(String synopsis)
    {
        this.synopsis = synopsis;
    }

    public String getSynopsis()
    {
        return synopsis;
    }
    public void setParentId(Long parentId)
    {
        this.parentId = parentId;
    }

    public Long getParentId()
    {
        return parentId;
    }
    public void setOrderNum(Integer orderNum)
    {
        this.orderNum = orderNum;
    }

    public Integer getOrderNum()
    {
        return orderNum;
    }

    public String getAncestors() {
        return ancestors;
    }

    public void setAncestors(String ancestors) {
        this.ancestors = ancestors;
    }

    public String getParentName() {
        return parentName;
    }

    public void setParentName(String parentName) {
        this.parentName = parentName;
    }

    public List<BookClass> getChildren() {
        return children;
    }

    public void setChildren(List<BookClass> children) {
        this.children = children;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("id", getId())
            .append("code", getCode())
            .append("name", getName())
            .append("synopsis", getSynopsis())
            .append("parentId", getParentId())
            .append("orderNum", getOrderNum())
            .append("createBy", getCreateBy())
            .append("createTime", getCreateTime())
            .append("updateBy", getUpdateBy())
            .append("updateTime", getUpdateTime())
            .append("remark", getRemark())
            .append("ancestors", getAncestors())
            .toString();
    }
}
